package com.itheima.reggie.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.itheima.reggie.dto.SetmealDto;
import com.itheima.reggie.entity.Setmeal;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SetMealMapper extends BaseMapper<Setmeal> {
    @Select("select setmeal.*,category.name categoryName from setmeal inner join category on category.id=setmeal.category_id ${ew.customSqlSegment}")
    IPage<SetmealDto> getPageAndCategoryName(IPage<SetmealDto> p, @Param(Constants.WRAPPER) Wrapper<Setmeal> wrapper);
}
